﻿$().ready(function () {
    var dates = $("#StartDateTime,#EndDateTime").datepicker({
        dateFormat: 'yy年mm月dd日',
        numberOfMonths: 3,
        onSelect: function (selectedDate) {
            var option = this.id == "StartDateTime" ? "minDate" : "maxDate",
					instance = $(this).data("datepicker"),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings);
            dates.not(this).datepicker("option", option, date);

            if (this.id == "StartDateTime")
                $("#EndDateTime").datepicker("show");
        }
    });
});